﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

using PlugNT.Safe;
using PlugNT.Custom;
using PlugNT.Database;
using PlugNT.Cms.Model;

namespace PlugNT.Cms.BLL
{
    public class Attachment
    {

        private static readonly PlugNT.Cms.DAL.Attachment dal = new PlugNT.Cms.DAL.Attachment();


        //public bool Exists(int id)
        //{
        //    return dal.Exists(id);
        //}

        /// <summary>
        /// 得到模型
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public AttachmentInfo GetAttachmentInfo(int id)
        {
            return dal.GetAttachmentInfo(id);

        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddAttachment(AttachmentInfo model)
        {
            return dal.AddAttachment(model);
        }

        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(AttachmentInfo model)
        {
            return dal.Update(model);
        }

        public bool OperationDownCount(int id, string operation)
        {
            return dal.OperationDownCount(id, operation);
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }


        public DataTable GetList(int sysModelId, string andWhere)
        {
            return dal.GetList(sysModelId, andWhere);
        }


        public DataTable GetList(int sysModelId, int topCount, int currPageCount, string andWhere, out int recordCount)
        {
            recordCount = dal.GetCount(sysModelId, andWhere);
            return dal.GetList(sysModelId, topCount, currPageCount, andWhere);
        }



    }
}
